package com.yugao.fintech.antelope.statistic.api;

import com.yugao.fintech.antelope.statistic.api.model.mq.StatisticMQ;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 统计消息发送者

 */
@Component
public class StatisticSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(StatisticMQ req) {
        rabbitTemplate.convertAndSend(StatisticMQ.EXCHANGE, StatisticMQ.KEY, req.toMessage());
    }
}
